<?php
require_once 'Common/values.php';
$query="UPDATE tblkbdocuments SET `Out`='true' , User='$user' WHERE DocNumber='$_GET[doc]'";
mysql_query($query);
$_POST[change]='Checked out by : '.$user;

$result = mysql_query("SELECT * FROM tblkbdocuments WHERE DocNumber='$_GET[doc]'");
$row = mysql_fetch_array($result);

$query="INSERT INTO tblkblog (DocNumber,Date,Time,`Change`,User,Rev) VALUES ('$_GET[doc]','$date','$time','$_POST[change]','$user',$row[Rev])";
mysql_query($query);

echo '<center><h3>Document checked out</h3><br><a href="file://'.$docpath.''.$row[Document].'">Open File</a><br><a href="index.php?p=kbchange&doc='.$_GET[doc].'">Check in</a>';

?>
